1. Field of the Invention
The present invention relates to computer graphics rendering and, more particularly, to methods, systems and computer programs for generating a boundary or an outline for stroking a thin line.
2. Related Application
Australian Patent Application No. 2003202435 entitled “Generating an outline of a stroked path” has the same inventor and applicant as the present application. The contents of Australian Patent Application No. 2003202435, which was published on 23 Oct. 2003, are incorporated herein by reference.
3. Background
The introduction of personal computers popularized the use of computer graphic systems for user-computer interaction. Computer graphics systems typically display and/or print text, images, polygons, paths, lines and many other objects. Such paths may comprise line and/or curve segments, which may be stroked to give an appearance of width when displayed or printed by a computer graphics rendering system. Path or line stroking is particularly useful in drawing and printing applications and in display device software such as video drivers, printer drivers, and input device drivers (e.g., in mouse-driven interactive CAD systems).
Computer graphics systems typically stroke paths in one domain before the paths are transformed to another domain (i.e., a device domain) for rendering. Numerous existing computer graphics systems employ stroking methods that approximate paths as line segments and then stroke the paths in the required domain. The result is a series of line segments that describe an outline of a fill area, which is known as a stroked outline. The stroked outline is transformed to a device domain prior to rendering.
A stroked path is typically drawn with a specified pen width, end cap style, and join style. An end cap is required at the start and the end of a stroked path. Computer graphics systems typically provide butt end caps, square end caps, and round end caps.
A join is required between 2 adjoining stroking lines where the tangent at the end of the previous curve is unequal to the tangent at the beginning of the next curve. Computer graphics systems typically provide mitre joins, bevel joins, and round joins.
In computer graphics systems that do not include an anti-aliasing rendering technique and in which a Raster Image Processor (RIP) responsible for generating pixels has limited x and y resolution (e.g., a known RIP has 28.4 fixed point x and y resolution, which has a smallest unit of 1/16 of a pixel), a problem arises when the stroking line is non-vertical and non-horizontal, and the stroking width in device space is less than a certain threshold (e.g., about 10 pixel units). The problem results from non-uniformity of the fill area for a stroked line and manifests visually as inconsistencies in thickness of stroked lines of different inclination and/or direction.
Techniques have been devised to address this problem, however, these have not been altogether successful. One such technique is disclosed in U.S. Pat. No. 5,461,703, entitled “Pixel Image Edge Enhancement Method and System”, which was issued to Goyins et al. and was published on 24 Oct. 1995. The technique generates approximately square ends for a fill area. However, the technique does not appear to achieve good results for all thin lines. Furthermore, the left and right lines are asymmetric about the centre stroking line and the additional adjustment to square up the end caps does not ameliorate this asymmetric problem.
FIG. 1 shows stroked lines of varying angles of inclination between 0 and 360 degrees generated by prior art methods. The concentric circles 100 in FIG. 1 enclose multiple stroked lines of varying angles of inclination between 0 and 360 degrees. Inconsistencies in stroked line thickness at certain angles of inclination, for example, the lines at 101 and 102, are clearly discernable as darker and lighter lines, respectively, in the rasterized image of FIG. 1. The problem commonly occurs where many thin lines of similar slope are drawn close to each other.
A need therefore exists to substantially overcome, or at least ameliorate, one or more disadvantages associated with existing arrangements. Another need exists to provide an improved raster-graphics imaging system capable of generating improved stroked outlines, particularly when the pen width is between 1 and 10 pixels or rendering device units.